﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="detail.aspx.vb" Inherits="myWebsite.detail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="MotorcycleDb">
            <Columns>
                <asp:BoundField DataField="Make" HeaderText="Make" SortExpression="Make" />
                <asp:BoundField DataField="Model" HeaderText="Model" SortExpression="Model" />
                <asp:BoundField DataField="Difficulty" HeaderText="Difficulty" 
                    SortExpression="Difficulty" />
                <asp:BoundField DataField="DetailedDescription" 
                    HeaderText="Detailed Description" SortExpression="DetailedDescription" />
                <asp:ImageField DataImageUrlField="Picture" HeaderText="Photo">
                    <ControlStyle Height="450px" Width="600px" />
                </asp:ImageField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="MotorcycleDb" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MotorcyclesConn %>" 
            ProviderName="<%$ ConnectionStrings:MotorcyclesConn.ProviderName %>" 
            SelectCommand="SELECT [Make], [Model], [Category], [Difficulty], [Picture], [DetailedDescription] FROM [MyTable] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
  
    <p>
        Write your comment below.</p>
    <p>
        Name: <br />
        <asp:TextBox ID="tb_Name" runat="server" Width="233px"></asp:TextBox>
    </p>
    <p>
        Title: <br />
        <asp:TextBox ID="tb_Title" runat="server" Width="228px"></asp:TextBox>
    </p>
    <p>
        Add your comment: <br />
        <asp:TextBox ID="tb_Comment" runat="server" Height="214px" Width="358px" 
            TextMode="MultiLine"></asp:TextBox>
    </p>
    <p>
        <asp:Button ID="btn_AddComment" runat="server" Text="Button" />
    </p>
    <br />
    <br />
    <br />
    <br />
    <div style ="overflow:auto;height:400px;width:700px">

    <p>
        &nbsp;</p>
    <p>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1" Height="131px" Width="346px">
            <Columns>
                <asp:TemplateField HeaderText="Comments">
                <ItemTemplate> 
                <div style="background-color:Silver">
                <b> 
                <center>
                <span style="text-decoration:underline">
                <h1><%# Eval("Author") %></span></center></b></h1>
                <br />        
                <b>
                <%# Eval("Subject") %> </b>
                <br />         
                <br />          
                <%# Eval("Message") %>
                </div>
                </ItemTemplate>

                <AlternatingItemTemplate>
                <div style="background-color:White">
                <b> 
                <center>
                <span style="text-decoration:underline">
                <h1><%# Eval("Author") %></span></center></b></h1>
                <br />        
                <b>
                <%# Eval("Subject") %> </b>        
                <br />     
                <br />              
                <%# Eval("Message") %>
                </div>                
                </AlternatingItemTemplate>

                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        </div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MotorcyclesConn %>" 
            ProviderName="<%$ ConnectionStrings:MotorcyclesConn.ProviderName %>" 
            SelectCommand="SELECT [Author], [Subject], [Message] FROM [Comments] WHERE ([MotorcyclesID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="MotorcyclesID" QueryStringField="ID" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>
